/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AssemblerUI;

import java.util.HashMap;

/**
 *
 * @author mahesh
 */
public class OpcodeTable {
    public OpcodeTable()
    {
        mapOpcode.put( "HLT", 0 );
        //mapOpcode.put( "hlt", 0 );
        mapOpcode.put( "Add", 4 );
    }
    
    public int GetOpcode( String instr )
    {
        Integer index = mapOpcode.get( instr );
        
        int opcode = -1;
        if( index != null )
            opcode = index.intValue();
        
        return opcode;
    }
    
    private HashMap<String, Integer> mapOpcode;
}
